using System;
using System.Text;
using System.Collections;
using System.Collections.Generic;

using SlimDX;
using SlimDX.Direct3D9;

using miciv.Rendering;

namespace miciv.Geometry
{
    public class ShapeTopology : IShapeTopology
    {
        protected PrimitiveType m_primitiveType;
        protected List<int> m_lstIndex;
        protected int m_primitiveSize;

        public ShapeTopology(int _sCapacity)
        {
            this.m_lstIndex = new List<int>(_sCapacity);
            this.PrimitiveType = PrimitiveType.PointList;
        }

        public void Add(int _uValue)
        {
            this.m_lstIndex.Add(_uValue);
        }

        #region IShapeTopology Members

        public PrimitiveType PrimitiveType
        {
            get
            {
                return this.m_primitiveType;
            }
            set
            {
                this.m_primitiveType = value;
            }
        }

        public int PrimitiveSize
        {
            get
            {
                return this.m_primitiveSize;
            }
            set
            {
                this.m_primitiveSize = value;
            }
        }

        public int Count
        {
            get
            {
                return this.m_lstIndex.Count;
            }
        }

        #endregion

        #region IEnumerable<int> Members

        public IEnumerator<int> GetEnumerator()
        {
            return this.m_lstIndex.GetEnumerator();
        }

        #endregion

        #region IEnumerable Members

        IEnumerator IEnumerable.GetEnumerator()
        {
            return this.m_lstIndex.GetEnumerator();
        }

        #endregion
    }
}
